This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
If you recycle someView first, and someDoc was pulled from that View, it will automagically recycle someDoc and you won't have a chance to set it to null.
- Never try to recycle a recycled object. For some obtuse reason this throws an Exception - one would expect that recycling an object that's been recycled would do nothing and drive on smartly. That's another reason to see everything to null once recycled, now one can tell what's been recycled and what hasn't with a trivial check against null.
- Also be sure that you are in fact recycling everything. It's insidious and easy to miss things. For instance, Document.replaceItemValue() returns an Item and that must be recycled just like anything else inside a loop. I do this:
Yeah I know the code's exiting and null isn't required. It's a tiny price to pay to be absolutely double-dog sure GC knows I'm done with it. I also know Domino is supposed to "clean up on exit". My experience is that any and all assistance one can render to that process is that much less likely to leak and blow up the server, particularly where thousands upon thousands upon thousands of Domino objects are processed.
- Lastly, if you know Java at all, it's vastly simpler to write a wrapper class to do all this stuff for you than it is to manage recycle in the main code. It's so useful one has to wonder why something akin to this isn't provided out of the box, say as a sample of proper recycling practices, instead of requiring every Java developer on Domino to re-invent the wheel.
- Leaks are a nasty PITA and any level of insurance is well done in my book. If this were C++ I'd be all over it, but in Java it's a horrid can of worms.
Hope this helps...
Feedback response number DGIE8G4KAU created by ~Holly Zekhipisonnivu on 04/20/2011